﻿using System.Web.Mvc;

namespace Heima.OA.UI.Portal.Areas.Declare
{
    public class DeclareAreaRegistration : AreaRegistration 
    {
        public override string AreaName 
        {
            get 
            {
                return "Declare";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context) 
        {
            context.MapRoute(
                "DeclareGlobalization", // 路由名称
                "{lang}/Declare/{controller}/{action}/{id}", // 带有参数的 URL
                new { lang = "zh", controller = "Home", action = "Index", id = UrlParameter.Optional }, // 参数默认值
                new { lang = "^[a-zA-Z]{2}-[a-zA-Z]{2}?$" }    //参数约束
            );
            context.MapRoute(
                "Declare_default",
                "Declare/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}